import request from '@/utils/request'

// 查询商家拼团申请列表
export function listApplication_active(query) {
  return request({
    url: '/group/application_active/list',
    method: 'get',
    params: query
  })
}

// 查询商家拼团申请详细
export function getApplication_active(id) {
  return request({
    url: '/group/application_active/' + id,
    method: 'get'
  })
}

// 新增商家拼团申请
export function addApplication_active(data) {
  return request({
    url: '/group/application_active',
    method: 'post',
    data: data
  })
}

// 修改商家拼团申请
export function updateApplication_active(data) {
  return request({
    url: '/group/application_active',
    method: 'put',
    data: data
  })
}

// 删除商家拼团申请
export function delApplication_active(id) {
  return request({
    url: '/group/application_active/' + id,
    method: 'delete'
  })
}

// 获取平台拼团活动列表选项
export function getPlatformGroupActivities() {
  return request({
    url: '/group/application_active/platformGroupActivities',
    method: 'get'
  })
}

// 获取商家列表选项
export function getMerchants() {
  return request({
    url: '/group/application_active/merchants',
    method: 'get'
  })
}

// 根据平台拼团活动ID获取关联的商家列表
export function getMerchantsByActivity(activityId) {
  return request({
    url: '/group/application_active/merchants/byActivity/' + activityId,
    method: 'get'
  })
}

// 获取商品SKU列表选项
export function getProductSkus() {
  return request({
    url: '/group/application_active/productSkus',
    method: 'get'
  })
}

// 更新申请状态（商家专用）
export function updateApplicationStatus(data) {
  return request({
    url: '/group/application_active/updateStatus',
    method: 'put',
    data: data
  })
}
